gulpfile.babel.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
cc 1
c 4
b 0
f 0
nc 1
nop 0
dl 0
loc 20
rs 9.4285
1
/**
2
*
3
* Gulpfile for strman
4
*
5
* @author Daniel Leite de Oliveira <[email protected]>
6
*
7
*/
8
import gulp from 'gulp';
9
import uglify from 'gulp-uglify';
10
import buffer from 'vinyl-buffer';
11
import browserify from 'browserify';
12
import babelify from 'babelify';
13
import es6ify from 'es6ify';
14
import deglobalify from 'deglobalify';
15
import source from 'vinyl-source-stream';
16
import babel from 'gulp-babel';
17
18
gulp.task('browserify', () => {
19
  browserify({
20
    entries: './src/strman.js',
21
    transform: [babelify, es6ify, deglobalify],
22
23
    // Generate a UMD bundle for the supplied export name.
24
    // This bundle works with other module systems and sets the name
25
    // given as a window global if no module system is found.
26
    standalone: '_s',
27
28
    // Enable source maps that allow you to debug your files
29
    // separately.
30
    debug: true
31
  })
32
  .bundle()
33
  .pipe(source('strman.js'))
34
  .pipe(buffer())
35
  .pipe(uglify())
36
  .pipe(gulp.dest('dist'));
37
});
38
39
gulp.task('babel', () => {
40
  gulp.src('./src/**/*.js')
41
    .pipe(babel({
42
      presets: ['es2015']
43
    }))
44
    .pipe(gulp.dest('transpiler'));
45
});
46
47
gulp.task('default', ['browserify', 'babel'], () => {});
48